<extend name="Public/base"/>

<block name="style">
	<link rel="stylesheet" href="__STATIC__/plugins/data-tables/DT_bootstrap.css" />
</block>

<block name="body">

    <!-- 数据列表 -->
    
    <div class="row">
        <div class="col-md-12">
            <!-- BEGIN EXAMPLE TABLE PORTLET-->
            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption">
                    	<i class="fa fa-globe"></i>
                        教师信息列表
                    </div>
                    <div class="tools">
                        <a href="javascript:;" class="collapse"></a>
                        <a href="#portlet-config" data-toggle="modal" class="config"></a>
                        <a href="javascript:;" class="reload"></a>
                    </div>
                </div>
                <div class="portlet-body">
                    <div class="table-toolbar">
                        <div class="btn-group">
                            <a class="btn green " href="{:U('User/add')}">新 增</a>
                            <button class="btn green ajax-post" url="{:U('User/changeStatus',array('method'=>'resumeUser'))}" target-form="ids">启 用</button>
                            <button class="btn green ajax-post" url="{:U('User/changeStatus',array('method'=>'forbidUser'))}" target-form="ids">禁 用</button>
                            <button class="btn green ajax-post confirm" url="{:U('User/changeStatus',array('method'=>'deleteUser'))}" target-form="ids">删 除</button>
                            <button class="btn green ajax-post confirm" url="{:U('Api/update',array('r'=>'user'))}" target-form="ids">更新缓存</button>
                        </div>
                    </div>
                    <table class="table table-striped table-bordered table-hover" id="sample">
                        <thead>
                            <tr>
                                <th class="table-checkbox"><input type="checkbox" class="group-checkable" data-set="#sample .checkboxes" /></th>
                                <th class="">UID</th>
                                <th class="">昵称</th>
                                <th class="">生日</th>
                                <th class="">邮箱</th>
                                <th class="">登录次数</th>
                                <th class="">最后登录时间</th>
                                <th class="">最后登录IP</th>
                                <th class="">状态</th>
                                <th class="">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <volist name="_list" id="vo">
                            <tr class="odd gradeX">
                                <td><input class="checkboxes ids" type="checkbox" name="id[]" value="{$vo.uid}" /></td>
                                <td>{$vo.uid} </td>
                                <td>{$vo.nickname}</td>
                                <td><span>{$vo.birthday|time_format=###,'Y-m-d'}</span></td>
                                <td>{$vo.email}</td>
                                <td>{$vo.login}</td>
                                <td><span>{$vo.last_login_time|time_format}</span></td>
                                <td><span>{:long2ip($vo['last_login_ip'])}</span></td>
                                <td>{$vo.status_text}</td>
                                <td><eq name="vo.status" value="1">
                                    <a href="{:U('User/changeStatus?method=forbidUser&id='.$vo['uid'])}" class="ajax-get">禁用</a>
                                    <else/>
                                    <a href="{:U('User/changeStatus?method=resumeUser&id='.$vo['uid'])}" class="ajax-get">启用</a>
                                    </eq>
                                    <eq name="UID" value="1">
                                        <a href="{:U('User/editUserinfo?uid='.$vo['uid'])}">编辑</a>
                                    </eq>

                                    <a href="{:U('User/changeStatus?method=deleteUser&id='.$vo['uid'])}" class="confirm ajax-get">删除</a>
                                    </td>
                            </tr>
                            </volist>
                        </tbody>
                    </table>
                    
                    <volist name="_list" id="vo">
                    <div class="modal fade" id="basic{$key}" tabindex="-1" role="basic{$key}" aria-hidden="true">
                    </div>	
                    </volist>
                    
                    <div class="page">
                        {$_page}
                    </div>
                </div>
            </div>
            <!-- END EXAMPLE TABLE PORTLET-->
        </div>
    </div>
</block>

<block name="script">
	<!-- BEGIN PAGE LEVEL PLUGINS -->
	<script type="text/javascript" src="__STATIC__/plugins/data-tables/jquery.dataTables.js"></script>
	<script type="text/javascript" src="__STATIC__/plugins/data-tables/DT_bootstrap.js"></script>
	<!-- END PAGE LEVEL PLUGINS -->
	<!-- BEGIN PAGE LEVEL SCRIPTS -->
	<script src="__STATIC__/scripts/app.js"></script>
	<script src="__STATIC__/scripts/table-managed.js"></script>     
	<script>
		jQuery(document).ready(function() {       
			App.init();
			TableManaged.init();
		});
	</script>
</block>
